import { createStore } from 'vuex'
import { getCart } from '@/api/cart'
export default createStore({
  state: {
    count:0
  },
  getters: {
  },
  mutations: {
   async getCartCount(state, parload) {
      state.count = parload.length
    }
  },
  actions: {
   async updateCart({commit}) {
    const {data} = await getCart()
      commit('getCartCount', data.res)
    }
  },
  modules: {
  }
})
